def init(root_api):
    from .user import UserView, UsersView, UserPasswordChangeView, UserInfoChangeView, UserPasswordResetView
    from .auth import AuthInfoView, LoginView, PasswordChangeView, InfoChangeView, LogoutView
    from .role import RoleView, RolesView

    api = root_api.namespace('user', description='用户管理')
    api.add_resource(UserView, '/user/<int:user_id>')  # get 获取指定用户信息 put 修改对象
    api.add_resource(UsersView, '/users')  # get 获取列表 post 新增
    api.add_resource(RolesView, '/role/roles')  # get 获取列表 post 新增
    # api.add_resource(CanApplyRolesView, '/role/apply/roles')
    api.add_resource(RoleView, '/role/<int:obj_id>')  # get 获取指定用户信息 put 修改对象

    # api.add_resource(MyLoginPage, '/mylogin')  # 后台测试登录页
    api.add_resource(PasswordChangeView, '/mypasswordchange')  # put 修改自己的密码
    api.add_resource(InfoChangeView, '/myinfochange')  # put 修改自己的信息
    # api.add_resource(UserPasswordChangeView, PRE_URL + '/user/passwordchange/<int:role_id>')  # put 修改对象
    api.add_resource(UserPasswordResetView, '/passwordreset/<int:user_id>')  # post 修改对象
    api.add_resource(UserInfoChangeView, '/userinfochange/<int:user_id>')  # put 修改对象
    # api.add_resource(SsoLoginView, '/ssologin')  # put 修改对象
    # api.add_resource(PermissionApplyView, '/applies')
    # api.add_resource(RolesView, '/roles')
    # api.add_resource(RoleView, '/<int:obj_id>')
    root_api.add_namespace(api)
    auth_api = root_api.namespace('auth', description='权限相关')
    auth_api.add_resource(AuthInfoView, '/info')  # get 获取当前用户信息
    auth_api.add_resource(LogoutView, '/auth/logout')  # get 登出接口
    auth_api.add_resource(LoginView, '/login')  # post 登录接口
    root_api.add_namespace(auth_api)
